<template>
	<view class="eval-game">
		<view class="tip" @longpress="longtap">
			本小程序仅供娱乐
		</view>
		<template-one 
			:gameId="data.Id"
			:typeId="typeId"
			:list="list"
			:data="data"
			@next="nextStep"
			v-if="data.typeId !== 17 && data.typeId !== 18 && data.typeId !== 23 && data.typeId !== 24 && data.typeId !== 26 && data.typeId !== 27"
			>
		</template-one>

		<template-two 
			:gameId="data.Id"
			:typeId="typeId"
			:list="list"
			:data="data"
			@next="nextStep"
			v-if="data.typeId == 17"
			>
		</template-two>

		<template-three
			:gameId="data.Id"
			:typeId="typeId"
			:data="data"
			@next="nextStep"
			v-if="data.typeId == 18"
			>
		</template-three>

		<template-four
			:gameId="data.Id"
			:typeId="typeId"
			:list="list"
			:data="data"
			@next="nextStep"
			v-if="data.typeId == 23"
			>
		</template-four>

		<template-five
			:gameId="data.Id"
			:typeId="typeId"
			:list="list"
			:data="data"
			@next="nextStep"
			v-if="data.typeId == 24"
			>
		</template-five>

		<template-six
			:gameId="data.Id"
			:typeId="typeId"
			:list="list"
			:data="data"
			@next="nextStep"
			v-if="data.typeId == 26"
			>
		</template-six>

		<template-seven
			:gameId="data.Id"
			:typeId="typeId"
			:data="data"
			@next="nextStep"
			v-if="data.typeId == 27"
			>
		</template-seven>
	</view>
</template>

<script>
	import TemplateOne from './template-one.vue'
	import TemplateTwo from './template-two.vue'
	import TemplateThree from './template-three.vue'
	import TemplateFour from './template-four.vue'
	import TemplateFive from './template-five.vue'
	import TemplateSix from './template-six.vue'
	import TemplateSeven from './template-seven.vue'
	export default {
		props: ['list', 'typeId', 'data', 'barHeight'],
		data() {
			return {
				isNext: false
			}
		},
		components: {
			TemplateOne,
			TemplateTwo,
			TemplateThree,
			TemplateFour,
			TemplateFive,
			TemplateSix,
			TemplateSeven,
		},
		methods: {
			nextStep(gameId, xzId) {
				if (!this.isNext) {
					uni.showLoading({
						title: "加载中"
					})
					uni.navigateTo({
						url: `/pages/game/game?id=${gameId}&xzId=${xzId}`
					})
					this.isNext = true
				} 
				setTimeout(() => { this.isNext = false }, 1000)
			},
			longtap(){
				uni.clearStorageSync()
				uni.showToast({
					title:"清理成功"
				})
			}
		},
		
	}
</script>

<style lang="scss" scoped>
	.eval {
		&-game {
			position: relative;
			width: 100vw;
			height: 100vh;

			.tip {
				position: absolute;
				bottom: 20rpx;
				z-index: 6;
				left: 50%;
				transform: translateX(-50%);
				color: #FFFFFF;
				background-color: #bbb;
				padding: 0rpx 10rpx;
				border-radius: 4rpx;
				opacity:0.7;
				line-height: 20px;
				font-size: 20rpx;
			}
		}
		
	}
</style>
